home *** CD-ROM | disk | FTP | other *** search
/ Practical Web Pages 2004 September / PracticalWebPages-WPG13-09-2004-Coverdisc.iso / pc / Software / Toolkit / Sothink SWF Quicker 1.5 / data1.cab / Public_Files / Effects / ActionScript / Scale / FadingShadow3.sqe < prev    next >
Encoding:
Text File  |  2004-06-14  |  2.6 KB  |  104 lines

  1. ========== Description Part Begin ==========
  2. name = "Fading Shadow3";
  3. description = "Each character reduces to a certain size and its shadow appears. ";
  4. version = "1.00";
  5. bin = "FadingShadow3.bin";
  6. ========== Description Part End ==========
  7.  
  8. ========== Parameter Part Begin ==========
  9. $nCharacterCount(EDIT,INT,1,1 10000,"Total Characters ","The total characters using the special effect. The value is defined by the selected characters in the movie, but can not be changed in the property box.");
  10. $nFrameCount(EDIT,INT,3,3 3,"Total Frames","It indicates the total frames of actions. The total frames of the effect is probably more than it.");
  11.  
  12. $nChangeSpeed(EDIT,INT,3,1 100,"Scaling Speed","To control the speed of character scaling.");
  13. $nAlphaSpeed(EDIT,INT,5,1 100,"Fading Speed","To control the speed of character fading.");
  14. $nMaxSize(EDIT,INT,300,100 10000,"Max Size","The maximum size of characters.");
  15.  
  16. ========== Parameter Part End ==========
  17.  
  18. ========== Function Part Begin ==========
  19. nFrameCount = 10;
  20. nCharacterCount = 4;
  21. nMaxSize = 300;
  22. nAlphaSpeed = 5;
  23. nChangeSpeed = 3;
  24.  
  25.  
  26.  
  27.  
  28. nChangeSize = 0;
  29. nOriginalSizeX = new Array(nCharacterCount);
  30. nOriginalSizeY = new Array(nCharacterCount);
  31.  
  32.  
  33. for (i = 1; i <= nCharacterCount; i++)
  34. {
  35.         nOriginalSizeX[i - 1] = this["c" + i ]._xscale;
  36.         nOriginalSizeY[i - 1] = this["c" + i ]._yscale;
  37.  
  38.         this["c" + i]._xscale = nMaxSize;
  39.         this["c" + i]._yscale = nMaxSize;
  40.         this["c" + i]._alpha = 0;
  41. }
  42.  
  43.  
  44. function again()
  45. {
  46.     gotoAndPlay(2);
  47. }
  48.  
  49.  
  50. function fun()
  51. {
  52.     nChangeSize += nChangeSpeed;    
  53.     if(c1._xscale <= nOriginalSizeX[0])
  54.     {
  55.         CopyObject();
  56.         return ;        
  57.     }
  58.     
  59.     
  60.     for (i = 1; i <= nCharacterCount; i++)
  61.     {
  62.         this["c" + i]._xscale -= nChangeSize;
  63.         this["c" + i]._yscale -= nChangeSize;
  64.         
  65.         if(this["c" + i]._xscale < nOriginalSizeX[i - 1])
  66.         {
  67.             this["c" + i]._xscale = nOriginalSizeX[i - 1];
  68.             this["c" + i]._yscale = nOriginalSizeY[i - 1];
  69.         }
  70.         this["c" + i]._alpha += nAlphaSpeed;
  71.         
  72.     }
  73.     
  74.     
  75. }
  76.  
  77.  
  78. function CopyObject()
  79. {
  80.         depth = nCharacterCount;
  81.         for (i = 1; i <= nCharacterCount; i++)
  82.         {
  83.             this["c" + i].duplicateMovieClip("t"+ i + 1, ++depth);
  84.         }
  85.         
  86.         for (i = 1; i <= nCharacterCount; i++)
  87.         {
  88.             this["t" + i + 1]._xscale += nChangeSize;
  89.             this["t" + i + 1]._yscale += nChangeSize;
  90.             this["t" + i + 1]._alpha -= nChangeSize;
  91.     
  92.         }
  93.         if(this["t" + nCharacterCount  + 1]._alpha < 0)
  94.             gotoAndPlay(1);
  95.             
  96. }
  97.  
  98. ========== Function Part End ==========
  99.  
  100. ========== Frame Part Begin ==========
  101. $frame(fun,1,-1,"fun");
  102. $frame(fun,2,-1,"fun");
  103. $frame(again,3,-1,"again");
  104. ========== Frame Part End ==========